<template>
  <div>
    <el-form :model="queryParam" :inline=true style="display: flex">
      <el-form-item label="名字">
        <el-input v-model="queryParam.name" style="width:160px"/>
      </el-form-item>
      <el-form-item label="公司名">
        <el-input v-model="queryParam.companyName" style="width:160px"/>
      </el-form-item>
      <el-form-item label="性别">
        <el-input v-model="queryParam.sex" style="width:160px"/>
      </el-form-item>
      <el-form-item label="职位">
        <el-input v-model="queryParam.stationName" style="width:160px"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="queryPage">搜索</el-button>
      </el-form-item>
    </el-form>
    <el-row>
      <el-col :span="2" v-for="item in tableData" :key="item.id">
        <el-link :href="item.value" target="_blank">
          <el-image
            style="width: 160px; height: 200px"
            :src="rootUrl.ossUrl+item.localImage">
          </el-image>
        </el-link>
        <span class="demonstration">{{ item.name + ' ' + item.stationName }}</span>
      </el-col>
    </el-row>
  </div>
</template>
<script>

import rootUrl from '../../../config/rootUrl'

export default {
  computed: {
    rootUrl() {
      return rootUrl
    }
  },
  data() {
    return {
      // 查询参数
      pageTotal: 0,
      queryParam: {
        companyName: '',
        name: '1',
        sex: '',
        stationName: '',
        pageNum: 1,
        pageSize: 36
      },

      tableData: []
    }
  },
  mounted() {
    this.pageList()
  },
  methods: {
    queryPage() {
      this.pageList()
    },
    pageList() {
      var _this = this
      this.$api.jfUserPageList(_this.queryParam).then(res => {
        if (res.code === '00000') {
          _this.tableData = res.data.pageList
          _this.pageTotal = res.data.pageTotal
        } else {
          _this.$message(res.msg)
        }
      }).catch(e => {
        console.log('接口访问异常!')
      })
    }
  }
}
</script>
